#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(nullptr);
    int T; cin >> T;
    while(T--){

        string s;
        int N, M;
        cin >> N >> M >> s;
        int cnt[s.size()+5]; memset(cnt, 0, sizeof(cnt));
        for (int i = 0; i < M; ++i) {
            int p; cin >> p;
            ++cnt[p-1];
        }
        for (int i = N-1; i > 0; --i) {
            cnt[i-1] += cnt[i];
        }
        int ans[26]; memset(ans, 0, sizeof(ans));
        for (int i = 0; i < N; ++i) {
            ans[s[i]-'a'] += cnt[i];
            ++ans[s[i]-'a'];
        }
        for (int i = 0; i < 26; ++i) {
            cout << ans[i] << ' ';
        }
        cout << "\n";
    }
    return 0;
}
